<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core"
    template="/mytemplate.xhtml">
    
    <ui:define name="metadata">
    </ui:define>
    <ui:define name="content">
    	<h3><h:outputLabel value="Find equipment page"></h:outputLabel></h3>
    	<br />
    	
    	<h:panelGrid columns="3">
            	<h:outputLabel value="Equipment name: "/>
                <p:inputText value="#{equipmentFindService.eName}"/>
                <p:commandButton value="Find" action="#{equipmentFindService.findEquipmentsByName()}"   
                             ajax="false" />
                <h:outputLabel value="Equipment Address: "/>
                <p:inputText value="#{equipmentFindService.eAddress}"/>
                <p:commandButton value="Find" action="#{equipmentFindService.findEquipmentByAddress()}"   
                             ajax="false" />
                <h:outputLabel value="Equipment type: "/>
                <p:inputText value="#{equipmentFindService.eType}"/>
                <p:commandButton value="Find" action="#{equipmentFindService.findEquipmentsByType()}"   
                             ajax="false" />
                <h:outputLabel value="Equipment state: "/>
                <p:inputText value="#{equipmentFindService.eState}"/>
                <p:commandButton value="Find" action="#{equipmentFindService.findEquipmentsByState()}"   
                             ajax="false" />
       	</h:panelGrid>
       	
       	<h:form>   
		    <p:dataTable id="dataTable" var="e" value="#{equipmentFindService.foundEquipments}" paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">  
		        <f:facet name="header">  
		            Found Equipments  
		        </f:facet>  
		  
		        <p:column sortBy="#{e.name}" headerText="Name">  
		            <h:outputText value="#{e.name}" />  
		        </p:column>  
		  
		        <p:column sortBy="#{e.address}" headerText="Address">  
		            <h:outputText value="#{e.address}" />  
		        </p:column>  
		  
		        <p:column sortBy="#{e.type}" headerText="Type">  
		            <h:outputText value="#{e.type}" />  
		        </p:column>  
		  
		        <p:column sortBy="#{e.creationDate}" headerText="Creation date">  
		            <h:outputText value="#{e.creationDate}" />  
		        </p:column>  
		        
		        <p:column sortBy="#{e.modificationDate}" headerText="Modification date">  
		            <h:outputText value="#{e.modificationDate}" />  
		        </p:column> 
		        
		        <p:column sortBy="#{e.objectState}" headerText="State">  
		            <h:outputText value="#{e.objectState}" />  
		        </p:column> 
		    </p:dataTable>  		  
		</h:form> 
   
    </ui:define>
</ui:composition>
